package cn.edu.hit.education.factory;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IExecutableExtensionFactory;
import org.eclipse.ui.part.ViewPart;

import cn.edu.hit.education.view.DepartmentExploreView;
import educationschedule.Application;

public class DepartmentExploreViewFactory implements IExecutableExtensionFactory,
		IExecutableExtension {
	private ViewPart view;

	public Object create() throws CoreException {
		return this.view;
	}

	public void setInitializationData(IConfigurationElement config,
			String propertyName, Object data) throws CoreException {
		this.view = (DepartmentExploreView)Application.applicationContext.getBean("departmentExploreView");
		this.view.setInitializationData(config, propertyName, data);
	}
}